<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加小店</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->

<script type="text/javascript">
$(function(){
	$.validator.addMethod("stringCheck", function(value, element) {          
		return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);       	
	}, "只能包括中文字、英文字母、数字和下划线");  

	$("#add_store").validate({
		rules:{
			store_name:{
				required:true
			},
			store_id:{
				required:true
			},
			store_url:{
				required:true
			},
			store_sorts:{
				required:true	
			}
			
		},
		messages:{
			store_name:{
				required:"小店名称不能为空！"
			},
			store_id:{
				required:"小店所在街道不能为空！"
			},
			store_url:{
				required:"小店url不能为空！"
			},
			store_sorts:{
				required:"请选择小店分类！"	
			}
		},
		errorPlacement:function(error,element){
			error.appendTo(element.siblings("div.validate_v"));
		}
	});
	
	$("#storetype").change(function(){
		var fenlei = $(this).val();
		$.post('<?php echo site_url('member/getfenlei')?>',{
				name:fenlei
			},function(data){
				var ret = $.parseJSON(data);
				if(ret.success=='true'){
					$("#storetypes").empty();
					$.each(ret.fenleiList,function(i,obj){
						var options = "<option value='"+obj.code+"'>"+obj.value+"</option>";
						$("#storetypes").append(options);
					});
				}
			});
	});

	$("#storespebus").change(function(){
		var fenlei = $(this).val();
		$.post('<?php echo site_url('member/getfenlei')?>',{
				name:fenlei
			},function(data){
				var ret = $.parseJSON(data);
				if(ret.success=='true'){
					$("#storespebuss").empty();
					$.each(ret.fenleiList,function(i,obj){
						var options = "<option value='"+obj.code+"'>"+obj.value+"</option>";
						$("#storespebuss").append(options);
					});
				}
			});
	});
})
</script>
</head>

<body>
	<!-- head -->
   <?php $this->load->view('head');?>
    <!-- head--end-->
    <?php $data['curstyle'] = 'store'?>
    <!-- body -->
    <div class="w100p mt40 mb20">
    	<div class="w903 mg">
        	<div class="box_s1">
            	<div class="b_head"></div>
                <div class="content m_pd_s1">
                	<!-- manage-top -->
                	<?php $this->load->view('member/mangtop',$data)?>
                    <!-- manage-top--end-->
                    
                    <!-- manage-det-->
                   <div class="clearfix">
                    	<div class="box_s3 fl">
                        	<div class="b_head"></div>
                            <?php $data['leftstyle'] = 'addstore'?>
                            <?php $this->load->view('member/storeleft',$data)?>
                            <div class="b_foot"></div>
                        </div>
                        
                        <!-- right-ope-->
                        <div class=" m_layout_s1">
                        	<div class="m_pd_s3">
                            	<div class="form_box">
                                	<h3>添加小店<?php if(isset($errorMsg)) echo '<font color="red">'.$errorMsg.'</font>'?></h3>
                                    <form action="<?php echo site_url('member/savestore')?>" id="add_store" method="post"  enctype="multipart/form-data">
                                        <table class="com_form com_form_s1 mt10 add_store" width="100%">
                                            <tbody>
                                                <tr>
                                                    <td width="115"  class="col1">*小店名称</td><td><input type="text" class="def_txt_s4" name="store_name" /><br class="clear" /><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">*所在街道编号</td><td><input type="text" class="def_txt_s4" name="store_id" /><br class="clear" /><div class="validate_v"></div></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">*小店地址</td><td><input type="text" class="def_txt_s4" name="store_url" /><br class="clear" /><div class="validate_v"></div></td>
                                                </tr>
                                                <tr>
                                                    <td  class="col1">英文地址</td><td><input type="text" class="def_txt_s4" name="eaddress"/><br class="clear" /><div class="validate_v"></div></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">*小店分类</td>
                                                    <td>
                                                       <select name="storetype" id="storetype" style="height: 25px;width: 60px;line-height: 25px;margin-right: 5px;">
                                                       	<option value="shenghuo">生活</option>
                                                       	<option value="fushi">服饰</option>
                                                       	<option value="wenhua">文化</option>
                                                       	<option value="xiuxian">休闲</option>
                                                       	<option value="meishi">美食</option>	
                                                       </select>
                                                       <select name="storetypes" id="storetypes" style="height: 25px;width: 100px;line-height: 25px;margin-right: 5px;">
                                                       	<?php foreach ($shenghuoList as $shenghuo):?>
                                                       		<option value="<?php echo $shenghuo['code']?>"><?php echo $shenghuo['value']?></option>
                                                       	<?php endforeach;?>
                                                       </select>
                                            		</td>
                                                </tr>
                                                <tr>
                                                    <td  class="col1">原创品牌</td>
                                                    <td>
                                                        <div class="select_wrap select_wrap_s1" style="z-index:99">
                                                            <div class=" def_drop_s1 drop"><span>请选择原创品牌</span></div>
                                                            <input type="hidden" name="storebrand"/>
                                                            <br class="clear"><div class="validate_v"></div>
                                                            <div class="select_data_box select" style=" display:none;">
                                                            	<?php foreach ($ycpp as $sb):?>
                                                                <p dataid="<?php echo $sb['code']?>" datavalue="<?php echo $sb['code']?>" class=""><?php echo $sb['value']?></p>
                                                                <?php endforeach;?>
                                                            </div>
                                                        </div>	
                                            		</td>
                                                </tr>
                                                <tr>
                                                    <td  class="col1">名人开店</td>
                                                    <td>
                                                        <div class="select_wrap select_wrap_s1" style="z-index:98">
                                                            <div class=" def_drop_s1 drop"><span>请选择名人开店</span></div>
                                                            <input type="hidden" name="storeperson"/>
                                                            <br class="clear" /><div class="validate_v"></div>
                                                            <div class="select_data_box select" style=" display:none;">
                                                            	<?php foreach ($storeperson as $sp):?>
                                                                <p dataid="<?php echo $sb['code']?>" datavalue="<?php echo $sb['code']?>" class=""><?php echo $sb['value']?></p>
                                                                <?php endforeach;?>
                                                            </div>
                                                        </div>	
                                            		</td>
                                                </tr>
                                                <tr>
                                                    <td  class="col1">特色商圈</td>
                                                    <td>
                                                        <div class="select_wrap select_wrap_s1" style="z-index:97">
                                                             <select name="storespebus" id="storespebus" style="height: 25px;width: 100px;line-height: 25px;margin-right: 5px;">
		                                                       	<option value="tsqy">特色区域</option>
		                                                       	<option value="yishu">艺术中心</option>
		                                                       	<option value="ditie">地铁小店</option>
		                                                       </select>
		                                                       <select name="storespebuss" id="storespebuss" style="height: 25px;width: 100px;line-height: 25px;margin-right: 5px;">
		                                                       	<?php foreach ($tsqyList as $tsqy):?>
		                                                       		<option value="<?php echo $tsqy['code']?>"><?php echo $tsqy['value']?></option>
		                                                       	<?php endforeach;?>
		                                                       </select>
                                                        </div>	
                                            		</td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">小店风格</td><td><input type="text" class="def_txt_s4" name="style"/><br class="clear"></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">营业时间</td><td><input type="text" class="def_txt_s4" name="bustime"/><br class="clear"></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">联系电话</td><td><input type="text" class="def_txt_s4" name="phone"/><br class="clear"></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1 top">小店文化</td><td><textarea class="def_ta_s4" name="history"></textarea></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1">tags</td><td><input name="tags" type="text" class="def_txt_s4" /><span class=" tip_2 ml10">标签</span></td>
                                                </tr>
                                                <tr>
                                                    <td  class="col1">照片</td><td><input type="text" class="def_txt_s4" id="photo_text" readonly="readonly" /><div class="upfile_wrap"><a href="javascript:void(0);" class="def_btn_s10 upload ml10">browse</a><input type="file" name="photo" class=" opacity_file" onchange="upload_photo(this);"/></div><span class=" tip_3">照片尺寸294x162px</span></td>
                                                </tr>
                                                <tr>
                                                    <td class="col1 top">地图链接</td>
                                                    <td>
                                                    	<textarea class="def_ta_s4" name="map"></textarea>
                                                        <div class="map_instruc mt20">
                                                        	<p>
                                                            	从<a href="#">http://ditu.google.cn/maps?hl=zh-cn&amp;tab=wl</a>定位到你想要的地图，然后<br />
                                                                在google上点击“分享链接”，将您的地图链接代码粘帖此处。
                                                            </p>
                                                            <p class="mt30">”分享链接“即<img src="../../images/others/icon_1.png" />，点击这个图标，将粘帖HTML以便嵌入到网站，这一栏的地图链接代码复制后粘帖此处。（输入地址时请输入具体城市和区域，才能定位准确）</p>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div class=" btn_box">
                                        	<input type="submit" class="def_btn_s5 mr10" value="保存" />
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="form_instruc">
                            	<div class="fi_item">
                                	<h3>小店分类</h3>
                                    <p>里面有5大分类，是添加小店的必填项，为单选。请选择其中一个大类后，在选择具体细分的小店类型。例如：你的小店主经营女装，可选择"服饰"，再选择"女装店"</p>
                                </div>
                                <div class="fi_item">
                                	<h3>原创品牌</h3>
                                    <p>如添加的小店还属于此类别，请选择所匹配的原创类型。添加成功后，将在原创这个类别出现你添加的小店。</p>
                                </div>
                                <div class="fi_item">
                                	<h3>名人开店</h3>
                                    <p>如添加小店的店主是名人，便可选择此项。添加成功后，将在名人开店这个类别出现你所添加的小店。</p>
                                </div>
                                <div class="fi_item">
                                	<h3>特色商圈</h3>
                                    <p>里面有"特色区域"、"艺术中心""地铁小店"三个地域的细分，你添加的小店还属于这个范围里面的，可先选择三个特色商圈中的一种，在选择具体地方。<br />例如 ：你的小店开在田子坊里面，便可选择"特色区域"中的"田子坊"，添加成功后，将在你选择的类别出现你所添加的小店。</p>
                                </div>
                                <div class="fi_item">
                                    <p>具体类别划分请查看<span>小店全部列表</span><br />请勿上传不符合我们小店要求的内容<br />填写完整的小店信息，将有助于推广你的小店</p>
                                </div>
                            </div>
                        </div>
                        <!-- right-ope--end-->
                        
                        <div class="clear"></div>
                    </div>
                    <!-- manage-det--end-->
                    
                </div>
                <div class="b_foot"></div>
            </div>
        </div>
    </div>
    <!-- body--end-->
    
    <!-- foot-->
   <?php $this->load->view('foot')?>
    <!-- foot--end-->	
</body>
<script type="text/javascript">
	function upload_photo(obj){
		var file_name = $(obj).val();
		$("#photo_text").val(file_name);
	}
</script>
</html>
